package com.ccp.dev.workflow.model;

import com.ccp.dev.core.basic.model.BaseModel;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.Objects;

@XmlRootElement(name = "aliasScript")
@XmlAccessorType(XmlAccessType.NONE)
public class AliasScript extends BaseModel {
    // ID
    @XmlElement
    protected String id;
    // 脚本的别名
    @XmlElement
    protected String aliasName;
    // 脚本的描叙
    @XmlElement
    protected String aliasDesc;
    // 调用类的路径
    @XmlElement
    protected String className;
    // 调用类的对象名
    @XmlElement
    protected String classInsName;
    // 调用的方法名
    @XmlElement
    protected String methodName;
    // 调用的方法的描叙
    @XmlElement
    protected String methodDesc;
    // 自定义脚本内容
    @XmlElement
    protected String scriptComten;
    // 方法返回类型
    @XmlElement
    protected String returnType;
    // 脚本类型（自定义：custom  系统默认：default）
    @XmlElement
    protected String scriptType;
    // 方法相关设置
    @XmlElement
    protected String argument;
    // 是否禁用（禁用：1   启用：0）
    @XmlElement
    protected Long enable;
    // 是否配置返回值（是：1   否：0）
    @XmlElement
    protected Short isReturnValue = 0;

    // 返回值参数设置
    @XmlElement
    protected String returnParamJson;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getAliasName() {
        return aliasName;
    }

    public void setAliasName(String aliasName) {
        this.aliasName = aliasName;
    }

    public String getAliasDesc() {
        return aliasDesc;
    }

    public void setAliasDesc(String aliasDesc) {
        this.aliasDesc = aliasDesc;
    }

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    public String getClassInsName() {
        return classInsName;
    }

    public void setClassInsName(String classInsName) {
        this.classInsName = classInsName;
    }

    public String getMethodName() {
        return methodName;
    }

    public void setMethodName(String methodName) {
        this.methodName = methodName;
    }

    public String getMethodDesc() {
        return methodDesc;
    }

    public void setMethodDesc(String methodDesc) {
        this.methodDesc = methodDesc;
    }

    public String getScriptComten() {
        return scriptComten;
    }

    public void setScriptComten(String scriptComten) {
        this.scriptComten = scriptComten;
    }

    public String getReturnType() {
        return returnType;
    }

    public void setReturnType(String returnType) {
        this.returnType = returnType;
    }

    public String getScriptType() {
        return scriptType;
    }

    public void setScriptType(String scriptType) {
        this.scriptType = scriptType;
    }

    public String getArgument() {
        return argument;
    }

    public void setArgument(String argument) {
        this.argument = argument;
    }

    public Long getEnable() {
        return enable;
    }

    public void setEnable(Long enable) {
        this.enable = enable;
    }

    public Short getIsReturnValue() {
        return isReturnValue;
    }

    public void setIsReturnValue(Short isReturnValue) {
        this.isReturnValue = isReturnValue;
    }

    public String getReturnParamJson() {
        return returnParamJson;
    }

    public void setReturnParamJson(String returnParamJson) {
        this.returnParamJson = returnParamJson;
    }

    @Override
    public String toString() {
        return "AliasScript{" +
                "id='" + id + '\'' +
                ", aliasName='" + aliasName + '\'' +
                ", aliasDesc='" + aliasDesc + '\'' +
                ", className='" + className + '\'' +
                ", classInsName='" + classInsName + '\'' +
                ", methodName='" + methodName + '\'' +
                ", methodDesc='" + methodDesc + '\'' +
                ", scriptComten='" + scriptComten + '\'' +
                ", returnType='" + returnType + '\'' +
                ", scriptType='" + scriptType + '\'' +
                ", argument='" + argument + '\'' +
                ", enable=" + enable +
                ", isReturnValue=" + isReturnValue +
                ", returnParamJson='" + returnParamJson + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof AliasScript)) {
            return false;
        }
        AliasScript that = (AliasScript) o;
        return Objects.equals(id, that.id) &&
                Objects.equals(aliasName, that.aliasName) &&
                Objects.equals(aliasDesc, that.aliasDesc) &&
                Objects.equals(className, that.className) &&
                Objects.equals(classInsName, that.classInsName) &&
                Objects.equals(methodName, that.methodName) &&
                Objects.equals(methodDesc, that.methodDesc) &&
                Objects.equals(scriptComten, that.scriptComten) &&
                Objects.equals(returnType, that.returnType) &&
                Objects.equals(scriptType, that.scriptType) &&
                Objects.equals(argument, that.argument) &&
                Objects.equals(enable, that.enable) &&
                Objects.equals(isReturnValue, that.isReturnValue) &&
                Objects.equals(returnParamJson, that.returnParamJson);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, aliasName, aliasDesc, className, classInsName, methodName, methodDesc, scriptComten, returnType, scriptType, argument, enable, isReturnValue, returnParamJson);
    }

    public AliasScript() {
    }
}
